package com.lanou.sinasports.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import com.lanou.sinasports.R;
import com.lanou.sinasports.adapter.TeamAdapter;

import java.util.List;

/**
 * Created by dllo on 16/1/7.
 */
public class TeamFragment extends Fragment {
    private ViewPager viewPager;
    private TeamAdapter adapter;
    private TabLayout tabLayout;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_team,container,false);
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
         viewPager= (ViewPager) view.findViewById(R.id.vp_team);
         tabLayout= (TabLayout) view.findViewById(R.id.tl_team);

    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        adapter=new TeamAdapter(getActivity().getSupportFragmentManager());
        viewPager.setAdapter(adapter);
        tabLayout.setupWithViewPager(viewPager);
    }
}
